#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QSystemTrayIcon>
#include <QCloseEvent>
#include <QFileDialog>
#include <QMessageBox>
#include <QFileDialog>
#include <QDesktopWidget>
#include <QSettings>
#include <QMenu>

#include "api.h"
#include "cleanup.h"
#include "optionsdialog.h"
#include "statisticsdialog.h"
#include "myprogressdialog.h"
#include "mycleanusbdialog.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
    void deviceArrived( const QString &disk, int flags );

protected:
    void changeEvent(QEvent *e);
    void closeEvent(QCloseEvent *event);

private:
    Ui::MainWindow *ui;
    drivesDataList genDrivesList;

    cleanup cleanupTread;
    optionsDialog * myOptionsDialog;
    myProgressDialog * progress;

    QAction * showAction;
    QSystemTrayIcon *trayIcon;
    QMenu *trayIconMenu;

    QString getLastSourceFolder() const;
    void setLastSourceFolder( const QString &path );
    void startCleanup();

private slots:
    void on_actionOptions_triggered();
    void on_folderCleanupButton_clicked();
    void on_allDrivesCleanupButton_clicked();
    void on_driveCleanupButton_clicked();
    void createActions();
    void initSysTray();
    void iconActivated(QSystemTrayIcon::ActivationReason reason);

    void threadFinished();
    void processStep( double );
    void on_cancelThread_clicked();
};

#endif // MAINWINDOW_H
